{{extends file="../admin/index.html"}}
{{block name=cssjs}}
{{/block}}
{{block name=nav}}栏目管理{{/block}}
{{block name=title}}栏目管理
<hr/>{{/block}}
{{block name=notice}}{{/block}}

{{block name=main}}

<div class="botton_art b1">
    <a href="index.php?c=column&a=add&id=0">
        <button class="btn btn-info" type="submit">新增顶级栏目</button>
    </a>
    <button class="btn btn-success sort">排序</button>
</div>
<hr/>


<div class="panel panel-info">
    <div class="panel-heading"><i class="fa fa-align-justify"></i><span> 栏目管理</span></div>

    <div class="panel-body">
        <form action="" method="post" class="form-horizontal" id="mainform">
            <table class="table table-bordered table-striped with-check">
                <thead>
                <tr>
                    <th class="col-md-1">排序</th>
                    <th class="col-md-6">名称</th>
                    <th class="col-md-3">栏目文章</th>
                    <th class="col-md-2"><i class="fa fa-cog"></i></th>
                </tr>
                </thead>

                <tbody>
                {{foreach $cates as $cate}}
                <tr>
                    <td>
                        <input type="text" value="{{$cate.orderId}}" size="1"
                               name="order[]"/>
                    </td>
                    <td class='name' style="text-align: left;">
                        <a href=""
                           target="_blank" title=""
                           class="tip-top">
                            {{for $i=1;$i<$cate.count;$i++ }}
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            {{/for}}
                            {{$cate.cateName}}

                            <span style="color:#a7cb52;">[{{if $cate.type eq 0}}封面
                                {{elseif $cate.type eq 1}}列表
                                  {{else}}URL跳转
                                {{/if}}]
                                {{if $cate.is_show eq 0}}
                                [隐藏]
                                {{/if}}
                                </span> </a>
                    </td>
                    <td style="width:80px;text-align: center;">
                        {{if $cate.type eq 1}}<a href="index.php?c=article&a=show_cate&cateId={{$cate.id}}">查看栏目文章</a>
                        {{/if}}
                    </td>
                    <td class="">
                        <a href="index.php?c=column&a=add&id={{$cate.id}}"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
                        <a href="index.php?c=column&a=edit&id={{$cate.id}}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
                        <a href="index.php?c=column&a=del_column&id={{$cate.id}}"><span class="glyphicon glyphicon-remove del" aria-hidden="true"></span></a>
                    </td>
                    <input type="hidden" value="{{$cate.id}}" class="id" name="id[]"/>
                </tr>
                {{/foreach}}
                </tbody>

            </table>
        </form>
    </div>
</div>


<script type="">
    $(function () {
        $(".sort").click(function(){
            $("#mainform").attr("action", "index.php?c=column&a=sort").submit();
        });

    });


</script>

{{/block}}